package com.jabo.wechatmomentsdemo.utils;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.jabo.wechatmomentsdemo.R;

/**
 * @anthor JZheng3
 * @Time: 2020/9/6
 */
public class GlideUtil {

    private static RequestOptions options = new RequestOptions()
            .placeholder(R.drawable.ic_launcher_background)//图片加载出来前，显示的图片
            .fallback( R.drawable.ic_launcher_background) //url为空的时候,显示的图片
            .error(R.drawable.ic_launcher_background);//图片加载失败后，显示的图片


    public static void loadUrlHandleErrorImage(Context c, String url, ImageView imageView){
        Glide.with(c).load(url).apply(options).into(imageView);
    }
}
